//
//  ZheDetailTableViewCell.m
//  Delicious
//
//  Created by 魏群 on 16/5/9.
//  Copyright © 2016年 gy. All rights reserved.
//

#import "ZheDetailTableViewCell.h"
#import "ZheDetailModel.h"
@implementation ZheDetailTableViewCell
- (void)setDataWithModel:(ZheDetailModel *)model
{
    [self.headImage sd_setImageWithURL:[NSURL URLWithString:model.referrer[@"profileImageUrl"]]];
    self.nicknameLabel.text = model.referrer[@"nickname"];
    self.descriptionLabel.text = model.Description;
    self.difficultyLabel.text = model.difficulty;
    self.timesLabel.text = model.times;
    self.tastesLabel.text = model.taste;
}
// 计算文本的自动返回高度
- (CGFloat)heightForText:(NSString *)string
{
    NSDictionary *dic = @{NSFontAttributeName : [UIFont systemFontOfSize:14]};
    CGRect rect = [string boundingRectWithSize:CGSizeMake(self.descriptionLabel.frame.size.width, 100000) options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
    return rect.size.height;
}



@end
